<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>7-获取对象的属性名</title>
</head>
<body>
    <script type="text/javascript">
        var obj = {
            username:'李宝莉',
            age :20,
            amount:100000
        };
        console.log(Object.keys(obj));
        //给对象添加属性
        obj.sex = '男';
        obj.clazz = '76班'; 
        console.log(obj);
    </script>
</body>
</html>